package Homework2;

public class Length {
    public static int length (String s) {
        int sum = 0;
        for (int i = 0; i < s.length(); i++){
            if (Character.isUpperCase(s.charAt(i))){
                sum++;
            } else if (Character.isLowerCase(s.charAt(i))) {
                sum++;
            }
        }
        return sum;

    }

    public static int length(int n) {
        int sum = 0, ns = n;
        for (int i = 0; ns != 0; i++){
            sum++;
            ns /= 10;
        }
        return sum;
    }
}
